package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * AffectationAnomalie generated by hbm2java
 */
@Entity
@Table(name = "AffectationAnomalie", schema = "dbo", catalog = "CRM")
public class AffectationAnomalie implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private AffectationAnomalieId id;
	private Anomalie anomalie;
	private Employe employe;
	private Intervention intervention;
	private Date date;

	public AffectationAnomalie() {
	}

	public AffectationAnomalie(AffectationAnomalieId id, Anomalie anomalie,
			Employe employe, Intervention intervention) {
		this.id = id;
		this.anomalie = anomalie;
		this.employe = employe;
		this.intervention = intervention;
	}

	public AffectationAnomalie(AffectationAnomalieId id, Anomalie anomalie,
			Employe employe, Intervention intervention, Date date) {
		this.id = id;
		this.anomalie = anomalie;
		this.employe = employe;
		this.intervention = intervention;
		this.date = date;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "anomalieId", column = @Column(name = "AnomalieId", nullable = false)),
			@AttributeOverride(name = "employeId", column = @Column(name = "employeId", nullable = false)),
			@AttributeOverride(name = "interventionId", column = @Column(name = "interventionId", nullable = false)) })
	public AffectationAnomalieId getId() {
		return this.id;
	}

	public void setId(AffectationAnomalieId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "AnomalieId", nullable = false, insertable = false, updatable = false)
	public Anomalie getAnomalie() {
		return this.anomalie;
	}

	public void setAnomalie(Anomalie anomalie) {
		this.anomalie = anomalie;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "employeId", nullable = false, insertable = false, updatable = false)
	public Employe getEmploye() {
		return this.employe;
	}

	public void setEmploye(Employe employe) {
		this.employe = employe;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "interventionId", nullable = false, insertable = false, updatable = false)
	public Intervention getIntervention() {
		return this.intervention;
	}

	public void setIntervention(Intervention intervention) {
		this.intervention = intervention;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", length = 23)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

}
